package cn.enilu.flash.bean.entity.house;

import cn.enilu.flash.bean.entity.BaseEntity;
import cn.enilu.flash.code.Generator;
import lombok.Data;
import org.hibernate.annotations.Table;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.validation.constraints.NotNull;

/**
 * @Description
 * @Author Spark
 * @Date Created in (2019/10/28 13:44)
 * @Version v1.0
 * @Modify
 **/
@Entity(name="community_info")
@Table(appliesTo = "community_info",comment = "社区")
@Data
@EntityListeners(AuditingEntityListener.class)
public class CommunityInfo extends BaseEntity {
    @Column(columnDefinition = "VARCHAR(256) COMMENT '社区名称'")
    @NotNull(message = "社区名称不能为空")
    private String name;

    @Column(name = "province_code", columnDefinition = "VARCHAR(12) COMMENT '省代码'")
//    @NotNull(message = "省代码不能为空")
    private String provinceCode;

    @Column(name = "province_name", columnDefinition = "VARCHAR(64) COMMENT '省名称'")
    private String provinceName;

    @Column(name = "city_code", columnDefinition = "VARCHAR(12) COMMENT '市代码'")
//    @NotNull(message = "市代码不能为空")
    private String cityCode;

    @Column(name = "city_name", columnDefinition = "VARCHAR(256) COMMENT '市名称'")
    private String cityName;

    @Column(name = "area_code", columnDefinition = "VARCHAR(12) COMMENT '区代码'")
//    @NotNull(message = "区代码不能为空")
    private String areaCode;

    @Column(name = "area_name", columnDefinition = "VARCHAR(256) COMMENT '区名称'")
    private String areaName;

    @Column(name = "street", columnDefinition = "VARCHAR(256) COMMENT '街道'")
    private String street;

    @Column(name = "has_file", columnDefinition = "INT COMMENT '是否有影像文件'")
    private int hasFile = 0;


}
